function  dydx =  bond_pricing_ode_w(  x, y, par,  par_bonds , deltav)
% This function solves v(w, lambda) as a function w for a fixed lambda, assuming that we know (or we do not need to know) the information for
% different lambda 
% y = ( v, v' ),   x = w

% v and v prime
w = x;
v  =  y(1);
vprime = y(2); 

% Other values
lambda=par_bonds.lambda; 
tau=par_bonds.tau;   pi=par_bonds.pi;    hat_kappa0 = par_bonds.hat_kappa0;
lambda_tau = 1/tau - pi*lambda;
kappap = par_bonds.kappap_fun(w);
xK = par_bonds.xK_fun(w);
sigmap = par_bonds.sigmap_fun(w);
sigmaw = par_bonds.sigmaw_fun(w);
kappaw = par_bonds.kappaw_fun(w);
kappab = par_bonds.kappab_fun(w);
muw = par_bonds.muw_fun(w);
rf = par_bonds.rf_fun(w);

% Calculate v double prime
vdoubleprime = (  ( lambda * pi ./ ( 1 - kappab )  .* ( v - (1-kappap-hat_kappa0)  )  + lambda * (1-pi) ./ ( 1 - kappab )*deltav  + lambda_tau .* (v-1)  +  xK.*(par.sigmaK+sigmap).^2 * vprime * w * sigmaw  ) + rf*v - vprime*w*muw   ) ./ (  0.5*w^2*sigmaw^2 ) ;

% Output derivatives
dydx= [  vprime;  vdoubleprime ];













